﻿<Application x:Class="AgilePlannerDT.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <Application.Resources>
        <Style x:Key="InvisibleButton" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Bottom" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="RoundedCornerTextBox" TargetType="{x:Type TextBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                        <Grid>
                            <Rectangle RadiusX="15" RadiusY="15" Fill="{TemplateBinding Property=Background}" Stroke="{TemplateBinding Property=BorderBrush}" StrokeThickness="{TemplateBinding Property=BorderThickness}"/>
                            <TextBlock HorizontalAlignment="{TemplateBinding Property=HorizontalContentAlignment}" 
                                       VerticalAlignment="{TemplateBinding Property=VerticalContentAlignment}" 
                                       Text="{TemplateBinding Property=Text}" 
                                       Margin="{TemplateBinding Property=Padding}" 
                                       Foreground="{TemplateBinding Property=Foreground}"
                                       Background="Transparent" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="StatusButton" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Border Padding="0,0,0,10" Background="{TemplateBinding Property=Background}">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                                </ContentPresenter>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="RoundButton" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Ellipse Stroke="{TemplateBinding Property=BorderBrush}" StrokeThickness="{TemplateBinding Property=BorderThickness}" Fill="{TemplateBinding Property=Background}" />
                            <Ellipse Stroke="{TemplateBinding Property=Foreground}" StrokeThickness="2" Margin="3"/>
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="GradientBlackToGrayBorder" TargetType="{x:Type Border}">
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.486,0.986" StartPoint="0.486,0">
                        <GradientStop Color="#FF000000" Offset="0"/>
                        <GradientStop Color="#FF8D8D8D" Offset="0.558"/>
                        <GradientStop Color="#FF747474" Offset="0.615"/>
                        <GradientStop Color="#FF8D8D8D" Offset="0.76"/>
                        <GradientStop Color="#FFD0D0D0" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ColorPaletteButton" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Border Margin="0" CornerRadius="25" BorderBrush="DarkGray" BorderThickness="1" Background="{TemplateBinding Property=Background}">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="GlassButton" TargetType="{x:Type Button}">
            <Setter Property="Template" Value="{DynamicResource GlassButtonTemplate}" />
        </Style>


        <ControlTemplate x:Key="GlassButtonTemplate" TargetType="{x:Type Button}">
            <ControlTemplate.Resources>
                <Storyboard x:Key="Timeline1">
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
                <Storyboard x:Key="Timeline2">
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </ControlTemplate.Resources>
            <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
                <Border x:Name="border" Background="#7F000000" BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.507*"/>
                            <RowDefinition Height="0.493*"/>
                        </Grid.RowDefinitions>
                        <Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="4,4,4,4">
                            <Border.Background>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="1.702" ScaleY="2.243"/>
                                            <SkewTransform AngleX="0" AngleY="0"/>
                                            <RotateTransform Angle="0"/>
                                            <TranslateTransform X="-0.368" Y="-0.152"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#B28DBDFF" Offset="0"/>
                                    <GradientStop Color="#008DBDFF" Offset="1"/>
                                </RadialGradientBrush>
                            </Border.Background>
                        </Border>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Grid.RowSpan="2" IsHitTestVisible="False"/>
                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="shine" Width="Auto" CornerRadius="4,4,0,0">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                                    <GradientStop Color="#99FFFFFF" Offset="0"/>
                                    <GradientStop Color="#33FFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                    </Grid>
                </Border>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Opacity" TargetName="shine" Value="0.4"/>
                    <Setter Property="Background" TargetName="border" Value="#CC000000"/>
                    <Setter Property="Visibility" TargetName="glow" Value="Hidden"/>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Trigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource Timeline1}"/>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <BeginStoryboard x:Name="Timeline2_BeginStoryboard" Storyboard="{StaticResource Timeline2}"/>
                    </Trigger.ExitActions>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Application.Resources>
</Application>
